package com.imsprint.javamvp.dagger2user;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;

import com.imsprint.javamvp.dagger2user.bean.User;
import com.imsprint.javamvp.dagger2user.di.DaggerMainComponent;
import com.imsprint.javamvp.dagger2user.di.MainModule;

import javax.inject.Inject;

public class MainActivity extends AppCompatActivity {
    private static final String TAG = "MainActivity";
    @Inject
    User user;
    @Inject
    User user2;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        DaggerMainComponent.builder().mainModule(new MainModule()).build().inject(this);
        Log.e(TAG, "onCreate: "+user.getName()+"  "+user.toString());
        Log.e(TAG, "onCreate2: "+user2.getName()+"  "+user2.toString());
        //
    }
}
